
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useSelectParalle = defineStore('selectParalle', () => {


    let paralle_index = ref(0); //默认选中0。  选中得是第几个并网。
    let paralle_id = ref(2); //默认选中得并网id。  默认不选中。


    let paralle_index_getter = computed(() => paralle_index.value);
    let paralle_id_getter = computed(() => paralle_id.value);

    function ch_paralle_index(num) {
        paralle_index.value = num
    }

    function ch_paralle_id(id) {
        paralle_id.value = id
    }


    let storage_id = ref(0);  //默认false
    let storage_index = ref(0);

    let storage_index_getter = computed(() => storage_index.value);
    let storage_id_getter = computed(() => storage_id.value);

    function ch_storage_index(num) {
        storage_index.value = num
    }

    function ch_storage_id(id) {
        storage_id.value = id
    }




    return {
        paralle_index_getter,
        paralle_id_getter,
        ch_paralle_index,
        ch_paralle_id,

        storage_index_getter,
        storage_id_getter,
        ch_storage_index,
        ch_storage_id

    }
})
